#include <jni.h>
#include <string>

extern "C" JNIEXPORT jstring JNICALL
Java_org_xc_x_1ffmpeg_MainActivity_stringFromJNI(
        JNIEnv *env,
        jobject /* this */) {
    std::string hello = "Hello from C++";
    return env->NewStringUTF(hello.c_str());
}

extern "C" {
#include <libavformat/avformat.h>
#include <android/log.h>
#define LOGI(FORMAT,...) __android_log_print(ANDROID_LOG_INFO,"ywl5320",FORMAT,##__VA_ARGS__);
}

extern "C"
JNIEXPORT void JNICALL
Java_org_xc_x_1ffmpeg_FFMpegUtil_Info(JNIEnv *env, jobject instance) {

    av_register_all();
    AVCodec *c_temp = av_codec_next(NULL);
    while (c_temp != NULL) {
        switch (c_temp -> type) {
            case AVMEDIA_TYPE_VIDEO:
                LOGI("VIDEO:%s",c_temp -> name)
                break;
            case AVMEDIA_TYPE_AUDIO:
                LOGI("AUDIO:%s",c_temp -> name)
                break;
            default:
                LOGI("OTHER:%s",c_temp -> name)
                break;
        }
        c_temp = c_temp -> next;
    }
}